package Decorator.joinBuilderPattern;

import Decorator.component.Beverage;

import java.util.ArrayList;
import java.util.List;

/**
 * @version : 1.0
 * @author: pengzx
 * @Description:
 * @date: 16:02 2017/11/16
 */
public class Meal {
    List<Beverage> beverages = new ArrayList<Beverage>(0);

    public boolean addBeverage(Beverage beverage){
        return beverages.add(beverage);
    }

    public double cost(){
        double price = 0;
        for(Beverage b:beverages){
            price += b.cost();
        }
        return price;
    }

}
